from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response


def jwt_response_payload_handler(token, user=None, request=None):
    # 自定义jwt认证成功返回数据
    return {'username': user.username, 'id': user.id, 'token': token}

class PageNum(PageNumberPagination):
    # 分页
    page_size = 10
    page_size_query_param = 'pagesize'
    max_page_size = 100